<?php

    function smarty_block_form($params, $content, &$smarty, &$repeat)
	{
		if (!$repeat)
		{
			$id = $params["id"]; // required. id value all time page or view class member value name.
			
			$page = isset($params["page"]) ? $params["page"] : PAGE_URL; // default value current page.

			$action = $params["action"]; // required
		
			if (isset($_GET["debug"]) && IS_DEBUG) 
			{
				// if passphrase using 
				$debug = (strlen($_GET["debug"]) > 0) ? "&debug=".$_GET["debug"] : "&debug";
			}

			if (defined("MULTIPART_FORM"))
			{
				$multipart_form = "enctype=\"multipart/form-data\"";
			}

			echo "<form id=\"$id\" name=\"Control:$id\" action=\"".HOST_URL."/".trim($page, "/")."/".trim($action, "/")
							."$debug\" $multipart_form method=\"post\">";

			echo  $content;
			echo "<input type=\"hidden\" name=\"".POSTBACK_KEYWORD."\" value=\"FromFormId:$id\" />";
			echo "</form>";
		}
	}

?>
